package io;

import java.io.*;

public class OOSDemo {
    public static void main(String[] args) throws IOException {
        // 对象流是一对高级流，作用是对象序列化  与反序列化
        String name = "刘桑";
        int age = 55;
        String gender = "男";
        String[] otherInfo = {"技术好", "技术超好"};
        Person p = new Person(name,age,gender,otherInfo);
        System.out.println(p);
        FileOutputStream fos = new FileOutputStream("person.obj");
        ObjectOutputStream oos = new ObjectOutputStream(fos);// 对象流，属于高级流
        oos.writeObject(p);

        System.out.println("写出完毕！");
        oos.close();

    }
}
